Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/14819: Avatar displayed in grey color for a few seconds for a non-existing account when invite for new member #15411

Conversation

tienifr
Copy link
Contributor

@tienifr tienifr commented Feb 23, 2023

Details

We are using the old default avatar on the workspace member page which causes the gray avatar to be displayed in a moment. We should remove the old default avatar because we had a new logic to update the default avatar.

Fixed Issues

$ #14819
$ PROPOSAL: #14819 (comment)

Tests

  1. Go to Setting - WS - Manage members
  2. Press the Invite button
  3. Entering a non-existing member and press the Invite button
  4. Verify that the new avatar is displayed immediately on the workspace member page
  • Verify that no errors appear in the JS console

Offline tests

Same as above

QA Steps

  1. Go to Setting - WS - Manage members
  2. Press the Invite button
  3. Entering a non-existing member and press the Invite button
  4. Verify that the new avatar is displayed immediately on the workspace member page
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Screen.Recording.2023-02-23.at.22.09.32.mp4
Mobile Web - Chrome
331824032_6283359905044115_5490476028431099719_n.mp4
Mobile Web - Safari
Screen.Recording.2023-02-23.at.22.13.22.mp4
Desktop
Screen.Recording.2023-02-23.at.22.15.55.mp4
iOS
Screen.Recording.2023-02-23.at.22.37.19.mp4
Android
Screen.Recording.2023-02-23.at.22.56.33.mp4

@tienifr tienifr requested a review from a team as a code owner February 23, 2023 15:22
@melvin-bot melvin-bot bot requested review from Beamanator and parasharrajat and removed request for a team February 23, 2023 15:22
@MelvinBot
Copy link

@Beamanator @parasharrajat One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@tienifr
Copy link
Contributor Author

tienifr commented Feb 24, 2023

Hi @parasharrajat @Beamanator Please help to review this PR, thanks

@parasharrajat
Copy link
Member

Sure.

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are killing it with the branch name. fix/14819-Avatar-displayed-in-grey-color-for-a-few-seconds-for-a-non-existing-account-when-invite-new-member.

@parasharrajat
Copy link
Member

parasharrajat commented Feb 24, 2023

Screenshots

🔲 iOS / native

screen-2023-02-25_04.04.59.mp4

🔲 iOS / Safari

screen-2023-02-25_03.00.54.mp4

🔲 MacOS / Desktop

screen-2023-02-25_02.31.38.mp4

🔲 MacOS / Chrome

screen-2023-02-25_02.33.15.mp4

🔲 Android / Chrome

screen-2023-02-28_09.15.52.mp4

🔲 Android / native

screen-2023-02-28_09.11.15.mp4

@tienifr
Copy link
Contributor Author

tienifr commented Feb 25, 2023

Hi @parasharrajat Could you help to complete the checklist?

Copy link
Contributor

@Beamanator Beamanator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, branch name looks fantastic 😅

@Beamanator
Copy link
Contributor

@parasharrajat are you still testing on Android? It looks like you included some screenshots in the comment with the full checklist, but not in this comment: #15411 (comment)

@parasharrajat
Copy link
Member

Lol, I forgot to add those. I will do that in 2 hours when I will start working.

@tienifr
Copy link
Contributor Author

tienifr commented Feb 28, 2023

@parasharrajat could you help to complete the screenshots in the checklist? 😅

@parasharrajat
Copy link
Member

Yes, doing it now.

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

cc: @Beamanator

🎀 👀 🎀 C+ reviewed

@tienifr
Copy link
Contributor Author

tienifr commented Feb 28, 2023

@Beamanator Everything is done, please help to check again and merge this PR. Thanks

@Beamanator Beamanator merged commit 85c2798 into Expensify:main Mar 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
Open Search Page TTI 624.728 ms → 673.516 ms (+48.788 ms, +7.8%)
App start TTI 673.312 ms → 690.922 ms (+17.610 ms, +2.6%)
App start runJsBundle 178.000 ms → 181.633 ms (+3.633 ms, +2.0%)
App start regularAppStart 0.013 ms → 0.013 ms (+0.000 ms, +1.4%)
App start nativeLaunch 22.906 ms → 21.935 ms (-0.971 ms, -4.2%)
Show details
Name Duration
Open Search Page TTI Baseline
Mean: 624.728 ms
Stdev: 22.753 ms (3.6%)
Runs: 587.0026860013604 587.5409759990871 591.883584998548 599.3968909978867 600.4745279997587 601.1073810011148 604.6256920024753 606.2054850012064 606.2671710029244 609.9457199983299 610.803508002311 610.8364260010421 615.8555909991264 616.93819199875 621.1982830017805 621.4961350001395 622.156128000468 625.186645001173 625.6895350031555 627.8815510012209 631.962564997375 632.4631760008633 634.0214029997587 635.5603030025959 639.7984220013022 641.7600510008633 642.7104489989579 650.8450520001352 651.2646900005639 655.5468350015581 662.5765380002558 667.7514239996672 677.2763670012355

Current
Mean: 673.516 ms
Stdev: 24.363 ms (3.6%)
Runs: 623.3758950009942 626.4154869988561 634.8949379995465 643.1527509987354 646.8317879997194 646.8844400011003 651.750489000231 658.6603199988604 661.0317380018532 662.7083339989185 662.7580169998109 663.4408770017326 663.5284429974854 666.2045489996672 668.3652760013938 669.0946860015392 674.9677740000188 678.6276859976351 681.3682049997151 682.8660480007529 683.2054040022194 684.2554119974375 685.5179449990392 686.8411859981716 686.9852290004492 690.7575280033052 691.1617439985275 696.69698099792 701.125854998827 704.4992680028081 706.8453369997442 707.7368569970131 733.4876310005784
App start TTI Baseline
Mean: 673.312 ms
Stdev: 20.322 ms (3.0%)
Runs: 635.2875059992075 644.0120679996908 644.7650570012629 647.4670189991593 649.2652300000191 650.844863999635 660.9176080003381 661.235011998564 661.9220280013978 663.1145370006561 663.3570480011404 670.2869750000536 671.4449459984899 671.7438919991255 673.1719469986856 674.6374550014734 677.0017560012639 677.8326140008867 677.8723889999092 679.9690960012376 680.1533190011978 680.404591999948 681.5711839981377 682.4722170010209 684.958533000201 690.5810110010207 695.652582000941 705.2695970013738 719.5369280017912 722.6086000017822

Current
Mean: 690.922 ms
Stdev: 35.928 ms (5.2%)
Runs: 632.0672929994762 642.5174800008535 643.7097110003233 645.754755999893 651.962460000068 656.6577249988914 659.7271290011704 663.1443740017712 663.5122510008514 667.8258050009608 668.6603530012071 673.0178489983082 673.0912970006466 679.1752009987831 679.7353719994426 684.8659919984639 686.1268749982119 688.5726470015943 690.1083509996533 704.0956839993596 711.7173260003328 714.2926959991455 721.1496969982982 721.9953930005431 723.0446100011468 727.416877001524 736.4915140010417 739.376302998513 747.5600569993258 757.6959320008755 763.5060649998486
App start runJsBundle Baseline
Mean: 178.000 ms
Stdev: 10.655 ms (6.0%)
Runs: 156 162 165 165 168 168 168 168 172 172 174 174 175 175 176 181 182 182 183 183 183 184 185 185 185 187 188 193 194 207

Current
Mean: 181.633 ms
Stdev: 17.982 ms (9.9%)
Runs: 156 159 160 165 167 168 168 168 169 169 170 173 173 176 176 177 178 180 180 181 182 188 196 197 204 205 212 213 218 221
App start regularAppStart Baseline
Mean: 0.013 ms
Stdev: 0.001 ms (4.1%)
Runs: 0.01192300021648407 0.012369997799396515 0.012370001524686813 0.012409999966621399 0.012409999966621399 0.012410998344421387 0.012492001056671143 0.012531999498605728 0.012573998421430588 0.012573998421430588 0.012614000588655472 0.012614000588655472 0.012655001133680344 0.012695003300905228 0.012776002287864685 0.012897998094558716 0.012940000742673874 0.013062000274658203 0.013103000819683075 0.013265002518892288 0.013305999338626862 0.013509001582860947 0.013550002127885818 0.013672001659870148 0.013712998479604721 0.013753999024629593 0.013793997466564178 0.013794001191854477

Current
Mean: 0.013 ms
Stdev: 0.001 ms (4.4%)
Runs: 0.012044999748468399 0.012288998812437057 0.012288998812437057 0.012370001524686813 0.012573998421430588 0.012614000588655472 0.01269499957561493 0.012695997953414917 0.012695997953414917 0.012736000120639801 0.012817997485399246 0.012818001210689545 0.01285799965262413 0.01285799965262413 0.012899000197649002 0.012938998639583588 0.013141997158527374 0.013183999806642532 0.013224001973867416 0.01326499879360199 0.01326499879360199 0.013265002518892288 0.013427000492811203 0.01342799887061119 0.01354999840259552 0.013670999556779861 0.013835001736879349 0.013996999710798264 0.013996999710798264 0.014242000877857208 0.014403998851776123
App start nativeLaunch Baseline
Mean: 22.906 ms
Stdev: 2.854 ms (12.5%)
Runs: 18 18 20 20 20 20 20 21 21 21 21 22 22 22 22 22 22 23 24 24 24 24 24 25 25 25 25 25 26 28 29 30

Current
Mean: 21.935 ms
Stdev: 2.663 ms (12.1%)
Runs: 18 19 19 19 19 19 20 20 20 20 20 21 21 21 21 22 22 22 22 22 22 22 24 24 24 24 25 25 26 28 29

@OSBotify
Copy link
Contributor

OSBotify commented Mar 2, 2023

🚀 Deployed to staging by https://github.com/Beamanator in version: 1.2.78-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Mar 6, 2023

🚀 Deployed to production by https://github.com/mountiny in version: 1.2.78-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants